package com.zfp.hs.service;

import com.zfp.core.service.BaseService;
import com.zfp.hs.dao.TimelineDao;
import com.zfp.hs.entity.Timeline;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Repository("timelineService")
public class TimelineService extends BaseService<Timeline> {
	@Autowired
	private TimelineDao timelineDao;

	public boolean save(Timeline timeline){
		int row = 0;
		if(timeline.getId() != null){
			row=timelineDao.update(timeline);
		}else{
			row = timelineDao.insert(timeline);
		}
		boolean flag=row>=1?true:false;
		return flag;
	}
	public boolean deleteById(Timeline timeline){
		int row = 0;
		if(timeline.getId() != null ){
			row=timelineDao.delete(timeline);
		}
		boolean flag=row>=1?true:false;
		return flag;
	}
}